package spring.event;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * Spring 事件驱动: 测试 Spring 事件发布
 *
 * @author ME
 * @date   2020/5/10
 */
public class TestSpringEvent {

    public static void main(String[] args) {
        ApplicationContext applicationContext = new AnnotationConfigApplicationContext(EventConfig.class);
        // 发布自己的事件
        applicationContext.publishEvent(new HungerEvent("Tom"));
    }
}
